import java.io.File;


public class First {
	public static void main(String[] args)  {
		File path;
		File file;
		
		if (args.length < 2 )
			System.out.println("Sie müssen Dateinamen und Suchpfad angeben");
		else {
			path = new File (args[0]);
			file = new File (args[1]);
			System.out.println("Gleicher Dateiname:");
			System.out.println(checkOne(file, path.listFiles()));
			System.out.println("Gleiche Datei:");
			System.out.println(checkTwo(file, path.listFiles()));
		}
		
	}	
	
	public static String checkOne (File f, File[] list){
		StringBuilder doub = new StringBuilder();
		for (int i=0; i < list.length; i++)
			if (list[i].isDirectory()){
				if (list[i].getName().equals(f.getName()))
					doub.append(list[i]+"/");
				doub.append(checkOne(f,list[i].listFiles()));
			}
			else 
				if (f.getName().equals(list[i].getName()))
					doub.append(list[i].getAbsolutePath() + "\n");
			
		return doub.toString();
	}

	
	public static String checkTwo (File f, File[] list){
		StringBuilder doub = new StringBuilder();
		for (int i=0; i < list.length && f.exists(); i++)
			if (list[i].isDirectory()){
				if (f.getName().equals(list[i].getName()) && f.length() == list[i].length())
				doub.append(checkTwo(f, list[i].listFiles()));
			}
			else
				if (list[i].isFile())
					if ( 
							f.getName().equals( list[i].getName() )    &&
							f.canExecute()   == list[i].canExecute()   &&
							f.length()       == list[i].length()       &&
							f.lastModified() == list[i].lastModified() &&
							f.isHidden()     == list[i].isHidden()     &&
							f.canRead()      == list[i].canRead()      &&
							f.canWrite()     == list[i].canWrite()     )
								doub.append(list[i].getAbsolutePath() + "\n");

		return doub.toString();
	}

	
}
